/*
 * Copyright 2007-2009 Perttu "celeron55" Ahola <celeron55@gmail.com>
 *
 * This file is part of jukumagic.
 *
 * jukumagic is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * jukumagic is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with jukumagic.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef RECT_H_
#define RECT_H_

#include "common.h"
#include "jukuobject.h"
#include "boardpoint.h"

enum RectSpecityType
{
	RECT_SPECIFY_WH,
	RECT_SPECIFY_X2Y2,
};

#define RECT_SPECIFY_DEFAULT RECT_SPECIFY_WH

#define RECT_MAX_LINE_WIDTH 100

class Rect : public JukuObject, BoardRect
{
	RectSpecityType m_spec;
public:
	Rect();
	Rect(Rect &rect);
	Rect(BoardRect r);
	~Rect();
	//void operator = (BoardRect r);
    JukuObjectType GetType(){ return TYPE_RECT; }
	const wxChar * GetShortString(void){return NULL;}
	const wxChar * GetTypeString(void){return _("Rect");}
 	JukuObject* MakeACopy();
	void WriteXML(TiXmlNode* root);
	static JukuObject* ReadFromXMLElement(TiXmlElement* element);
	void Draw(wxDC &dc, wxWindow *window, wxPoint origin);
	BoardRect GetDrawArea();
	
	void Move(int dx, int dy);

	void Rotate(TurnDirection dir, BoardPoint origin);
};

#endif
